/**
 * Copyright (c) 2006 RiseSoft Co.,Ltd  
 * $Header$
 */
package cn.newtest.bi.collection.model;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.GenericGenerator;

/**
 * TemplateFile的管理
 *
 * @author <a href="mailto: chenjian@risesoft.net">陈健</a>
 * @version $Revision$
 * 
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Table(name="Rpt_TemplateFile")
public class TemplateFile implements Comparable<Object>, Serializable {
	
	private static final long serialVersionUID = 1913074765871395379L;

	@Id
	@Column(name="TemplateFile_GUID",length=38)
	@GenericGenerator(name="TemplateFile-assigned",strategy="assigned")
	private String guid;
	
	/**
	 * TemplateFile的名字，用于显示，默认文件名
	 */
	@Column(name="TemplateFile_Name",length=100)
	private String name;
	
	/**
	 * 所引用的TemplateFile的url地址
	 */
	@Column(name="TemplateFile_Url",length=200)
	private String url;
	
	@Basic
	private Double tabIndex;
	
	@Lob
	private byte[] templateFile_Blob;
	
	@Lob
	private String addjsp;
	
	@Lob
	private String editjsp;
	
	@Lob
	private String viewjsp;
	
	@Lob
	private String validationXml;
	
	@Lob
	private String auditGroovy;
	
	@Lob
	private String calculateGroovy;
	
	@Lob
	private String validationJs;
	
	public String getAuditGroovy() {
		return auditGroovy;
	}

	public void setAuditGroovy(String auditGroovy) {
		this.auditGroovy = auditGroovy;
	}

	public String getCalculateGroovy() {
		return calculateGroovy;
	}

	public void setCalculateGroovy(String calculateGroovy) {
		this.calculateGroovy = calculateGroovy;
	}

	public String getValidationJs() {
		return validationJs;
	}

	public void setValidationJs(String validationJs) {
		this.validationJs = validationJs;
	}

	public String getValidationXml() {
		return validationXml;
	}

	public void setValidationXml(String validationXml) {
		this.validationXml = validationXml;
	}

	public String getAddjsp() {
		return addjsp;
	}

	public void setAddjsp(String addjsp) {
		this.addjsp = addjsp;
	}

	public String getEditjsp() {
		return editjsp;
	}

	public void setEditjsp(String editjsp) {
		this.editjsp = editjsp;
	}

	public String getViewjsp() {
		return viewjsp;
	}

	public void setViewjsp(String viewjsp) {
		this.viewjsp = viewjsp;
	}

	public byte[] getTemplateFile_Blob() {
		return templateFile_Blob;
	}

	public void setTemplateFile_Blob(byte[] templateFile_Blob) {
		this.templateFile_Blob = templateFile_Blob;
	}

	public String getGuid() {
		return guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getTabIndex() {
		return tabIndex;
	}

	public void setTabIndex(Double tabIndex) {
		this.tabIndex = tabIndex;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		TemplateFile myClass = (TemplateFile) object;
		return new CompareToBuilder().append(this.guid, myClass.guid).append(this.url, myClass.url).append(this.tabIndex, myClass.tabIndex).append(this.name, myClass.name).append(this.templateFile_Blob, myClass.templateFile_Blob)
				.toComparison();
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof TemplateFile)) {
			return false;
		}
		TemplateFile rhs = (TemplateFile) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(this.guid, rhs.guid).append(this.url, rhs.url).append(this.tabIndex, rhs.tabIndex).append(this.name, rhs.name).append(this.templateFile_Blob,
				rhs.templateFile_Blob).isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-725800335, -1667706833).appendSuper(super.hashCode()).append(this.guid).append(this.url).append(this.tabIndex).append(this.name).append(this.templateFile_Blob).toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("tabIndex", this.tabIndex).append("name", this.name).append("templateFile_Blob", this.templateFile_Blob).append("url", this.url).append("guid", this.guid).toString();
	}

}